package com.hxmall.fileserver.controller;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * Author Eirunye
 * Created by on 2018/9/6.
 * Describe
 */
@RestController
public class FileUploadController {

    @PostMapping(value = "/uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public String fileUploadTest(@RequestPart(value = "file") MultipartFile file) {
        return file.getName();
    }
}
